using System;
using System.ComponentModel;
using System.Data;
using System.Runtime.Serialization;

namespace MinCultura.Sipa.DataAccess.AgentesArtes
{
	/// <summary>
	/// A custom serializable datatable containing 
	/// </summary>
	[Serializable()]
	[DesignerCategory("code")]


	/// <summary>Class for handling datasets</summary>  
		public class AgentesData : DataTable
	{
		///
		/// Constants for table and fields mapping
		///
		public const string ART_AGENTES_TABLE = "ART_AGENTES";

		public const string AGE_ID_FIELD = "AGE_ID";		
		public const string ZOP_ID_FIELD = "ZOP_ID";
		public const string DOC_ID_FIELD = "DOC_ID";
		public const string ZON_ID_FIELD = "ZON_ID";		
		public const string MET_ID_FIELD = "MET_ID";				
		public const string AGE_FECHA_DILIGENCIAMIENTO_FIELD = "AGE_FECHA_DILIGENCIAMIENTO";
		public const string AGE_NOMBRES_APELLIDOS_FIELD = "AGE_NOMBRES_APELLIDOS";
		public const string AGE_SEUDONIMO_FIELD = "AGE_SEUDONIMO";
		public const string AGE_OTRA_CIUDAD_NACIMIENTO_FIELD = "AGE_OTRA_CIUDAD_NACIMIENTO";		
		public const string AGE_NUMERO_DOCUMENTO_FIELD = "AGE_NUMERO_DOCUMENTO";
		public const string AGE_TIENE_TARJETA_PROFECIONAL_FIELD = "AGE_TIENE_TARJETA_PROFECIONAL";
		public const string AGE_NUMERO_TARJETA_FIELD = "AGE_NUMERO_TARJETA";
		public const string AGE_ANO_EXPEDICION_TARJETA_FIELD = "AGE_ANO_EXPEDICION_TARJETA";		
		public const string AGE_POSEE_DICAPACIDA_FISICA_FIELD = "AGE_POSEE_DICAPACIDA_FISICA";
		public const string AGE_OTRA_DISCAPACIDAD_FISICA_FIELD = "AGE_OTRA_DISCAPACIDAD_FISICA";
		public const string AGE_PERTENECE_MINORIA_ETNICA_FIELD = "AGE_PERTENECE_MINORIA_ETNICA";
		public const string AGE_OTRA_MINORIA_FIELD = "AGE_OTRA_MINORIA";				
		public const string AGE_GENERO_FIELD = "AGE_GENERO";
		public const string AGE_FECHA_NACIMIENTO_FIELD = "AGE_FECHA_NACIMIENTO";
		public const string AGE_LUGAR_EXPEDICION_DOCUMENTO_FIELD = "AGE_LUGAR_EXPEDICION_DOCUMENTO";
		public const string AGE_TIENE_PASAPORTE_FIELD = "AGE_TIENE_PASAPORTE";
		public const string	AGE_NUMERO_PASAPORTE_FIELD = "AGE_NUMERO_PASAPORTE";
		public const string	AGE_FECHA_EXPEDICION_PASAPORTE_FIELD = "AGE_FECHA_EXPEDICION_PASAPORTE";
		public const string	AGE_FECHA_VENCIMIENTO_PASAPORTE_FIELD = "AGE_FECHA_VENCIMIENTO_PASAPORTE";
		public const string AGE_ORIGEN_FIELD = "AGE_ORIGEN";
		public const string AGE_USU_ID_FIELD = "AGE_USU_ID";		
		public const string AGE_ESTADO_FIELD = "AGE_ESTADO";
		public const string AGE_FECHA_VIGENCIA_INICIAL_FIELD = "AGE_FECHA_VIGENCIA_INICIAL";
		public const string AGE_FECHA_VIGENCIA_FINAL_FIELD = "AGE_FECHA_VIGENCIA_FINAL";


		protected AgentesData(SerializationInfo info, StreamingContext context)
		{
			//
		}

		public AgentesData()
		{
			BuildDataTables();
		}

		/// <summary>
		/// Creates the following datatables: Localidades
		/// </summary>
		private void BuildDataTables()
		{
			Columns.Add(AGE_ID_FIELD, typeof (Decimal));
			Columns[AGE_ID_FIELD].Caption = "Id Agente";

			Columns.Add(ZOP_ID_FIELD, typeof (Int32));
			Columns[ZOP_ID_FIELD].Caption = "Id Pais";

			Columns.Add(DOC_ID_FIELD, typeof (Decimal));
			Columns[DOC_ID_FIELD].Caption = "Tipo Documento";

			Columns.Add(ZON_ID_FIELD, typeof (String));
			Columns[ZON_ID_FIELD].Caption = "Id Municipio";

			Columns.Add(MET_ID_FIELD, typeof (Decimal));
			Columns[MET_ID_FIELD].Caption = "Minoria Etnica";

			Columns.Add(AGE_FECHA_DILIGENCIAMIENTO_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_DILIGENCIAMIENTO_FIELD].Caption = "Fecha Diligenciamiento";

			Columns.Add(AGE_NOMBRES_APELLIDOS_FIELD, typeof (String));
			Columns[AGE_NOMBRES_APELLIDOS_FIELD].Caption = "Nombres y Apellidos";

			Columns.Add(AGE_SEUDONIMO_FIELD, typeof (String));
			Columns[AGE_SEUDONIMO_FIELD].Caption = "Seudonimo";

			Columns.Add(AGE_OTRA_CIUDAD_NACIMIENTO_FIELD, typeof (String));
			Columns[AGE_OTRA_CIUDAD_NACIMIENTO_FIELD].Caption = "Otra Ciudad Nacimiento";

			Columns.Add(AGE_NUMERO_DOCUMENTO_FIELD, typeof (String));
			Columns[AGE_NUMERO_DOCUMENTO_FIELD].Caption = "Num Documento";

			Columns.Add(AGE_TIENE_TARJETA_PROFECIONAL_FIELD, typeof (String));
			Columns[AGE_TIENE_TARJETA_PROFECIONAL_FIELD].Caption = "Tiene Tarjeta Profecional";

			Columns.Add(AGE_NUMERO_TARJETA_FIELD, typeof (String));
			Columns[AGE_NUMERO_TARJETA_FIELD].Caption = "Num Tarjeta Profecional";

			Columns.Add(AGE_ANO_EXPEDICION_TARJETA_FIELD, typeof (String));
			Columns[AGE_ANO_EXPEDICION_TARJETA_FIELD].Caption = "Ano Tarjeta Profecional";

			Columns.Add(AGE_POSEE_DICAPACIDA_FISICA_FIELD, typeof (String));
			Columns[AGE_POSEE_DICAPACIDA_FISICA_FIELD].Caption = "Posee Discapacidad Fisica";

			Columns.Add(AGE_OTRA_DISCAPACIDAD_FISICA_FIELD, typeof (String));
			Columns[AGE_OTRA_DISCAPACIDAD_FISICA_FIELD].Caption = "Otra Discapacidad Fisica";

			Columns.Add(AGE_PERTENECE_MINORIA_ETNICA_FIELD, typeof (String));
			Columns[AGE_PERTENECE_MINORIA_ETNICA_FIELD].Caption = "Pertenece a Minoria Etnica";

			Columns.Add(AGE_OTRA_MINORIA_FIELD, typeof (String));
			Columns[AGE_OTRA_MINORIA_FIELD].Caption = "Otra Minoria";

			Columns.Add(AGE_GENERO_FIELD, typeof (String));
			Columns[AGE_GENERO_FIELD].Caption = "Genero";

			Columns.Add(AGE_FECHA_NACIMIENTO_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_NACIMIENTO_FIELD].Caption = "Fecha Nacimiento";

			Columns.Add(AGE_LUGAR_EXPEDICION_DOCUMENTO_FIELD, typeof (String));
			Columns[AGE_LUGAR_EXPEDICION_DOCUMENTO_FIELD].Caption = "Lugar Expedicion Documento";

			Columns.Add(AGE_TIENE_PASAPORTE_FIELD, typeof (byte));
			Columns[AGE_TIENE_PASAPORTE_FIELD].Caption = "Tiene Pasaporte";
			
			Columns.Add(AGE_NUMERO_PASAPORTE_FIELD, typeof (String));
			Columns[AGE_NUMERO_PASAPORTE_FIELD].Caption = "Numero Pasaporte";

			Columns.Add(AGE_FECHA_EXPEDICION_PASAPORTE_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_EXPEDICION_PASAPORTE_FIELD].Caption = "Fecha Expedicion Pasaporte";

			Columns.Add(AGE_FECHA_VENCIMIENTO_PASAPORTE_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_VENCIMIENTO_PASAPORTE_FIELD].Caption = "Fecha Vencimiento Pasaporte";

			Columns.Add(AGE_ORIGEN_FIELD,typeof (short));
			Columns[AGE_ORIGEN_FIELD].Caption = "Origen";

			Columns.Add(AGE_USU_ID_FIELD,typeof (decimal));
			Columns[AGE_USU_ID_FIELD].Caption = "Id Usuario Propietario";

			Columns.Add(AGE_ESTADO_FIELD,typeof (string));
			Columns[AGE_ESTADO_FIELD].Caption = "Estado";

			Columns.Add(AGE_FECHA_VIGENCIA_INICIAL_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_VIGENCIA_INICIAL_FIELD].Caption = "Fecha Vigencia Inicial";

			Columns.Add(AGE_FECHA_VIGENCIA_FINAL_FIELD, typeof (DateTime));
			Columns[AGE_FECHA_VIGENCIA_FINAL_FIELD].Caption = "Fecha Vigencia Final";

			PrimaryKey = new DataColumn[]{Columns[AgentesData.AGE_ID_FIELD]};

			TableName = ART_AGENTES_TABLE;
		}

		/// <summary>
		/// Add a new row to the table
		/// </summary>
		/// <param name="row">Dataset row
		public void addAgentes(DataRow row)
		{
			this.Rows.Add(row);
		}

	}

}